<extend name="./Common/View/Public/form.html" />
<block name="page_title">编辑菜单</block>
<block name="main">
        <form class="layui-form" method="post" action="sys/menu/update" lay-filter="pageForm">
            <input type="hidden" value="{$data.id}" name="id" />
            <div class="layui-form-item">
                <label class="layui-form-label">所属应用</label>
                <div class="layui-input-block">
                    <select name="app_id" id="app_id" lay-filter="appId" lay-verify="required" api="sys/application/slist" value="{$data.app_id}" affect="#pid" empty="请选择应用">
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">上级菜单</label>
                <div class="layui-input-block">
                    <select name="pid" id="pid" lay-filter="pid" value="{$data.pid}" api="sys/menu/slist?pid=0&type=3" empty="顶级菜单">
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">菜单名称</label>
                <div class="layui-input-inline">
                    <input type="text" name="title" maxlength="50" minlength="1" value="{$data.title}" required lay-verify="required|length" placeholder="请输入菜单名称" autocomplete="off" class="layui-input" />
                </div>
                <div class="layui-form-mid layui-word-aux">1-6个英文或汉字</div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">菜单地址</label>
                <div class="layui-input-block">
                    <input type="text" name="url" maxlength="200" minlength="1" value="{$data.url}" required lay-verify="required|length" placeholder="/模块/控制器/方法,如:/sys/menu/index" autocomplete="off" class="layui-input" />
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">菜单类型</label>
                <div class="layui-input-block">
                    {:W('Todo/Dict/radio',array('MENU_TYPE','type',$data['type']))}
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">菜单状态</label>
                <div class="layui-input-block">
                    {:W('Todo/Dict/radio',array('STATUS','status',$data['status']))}
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">展示排序</label>
                <div class="layui-input-inline">
                    <input type="number" name="sort" required lay-verify="required|int" value="{$data.sort}" autocomplete="off" class="layui-input" />
                </div>
                <div class="layui-form-mid layui-word-aux">从小到大排序</div>
            </div>
            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label">菜单说明</label>
                <div class="layui-input-block">
                    <textarea name="remark" placeholder="菜单描述说明" class="layui-textarea">{$data.remark}</textarea>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="pageForm">立即提交</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>
        </form>
    </block>